import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/device/get_device_records_list_entity.dart';

GetDeviceRecordsListEntity $GetDeviceRecordsListEntityFromJson(Map<String, dynamic> json) {
  final GetDeviceRecordsListEntity getDeviceRecordsListEntity = GetDeviceRecordsListEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    getDeviceRecordsListEntity.id = id;
  }
  final String? maintenanceRecords = jsonConvert.convert<String>(json['maintenanceRecords']);
  if (maintenanceRecords != null) {
    getDeviceRecordsListEntity.maintenanceRecords = maintenanceRecords;
  }
  final int? operatorsId = jsonConvert.convert<int>(json['operatorsId']);
  if (operatorsId != null) {
    getDeviceRecordsListEntity.operatorsId = operatorsId;
  }
  final String? operators = jsonConvert.convert<String>(json['operators']);
  if (operators != null) {
    getDeviceRecordsListEntity.operators = operators;
  }
  final String? operationTimeStart = jsonConvert.convert<String>(json['operationTimeStart']);
  if (operationTimeStart != null) {
    getDeviceRecordsListEntity.operationTimeStart = operationTimeStart;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    getDeviceRecordsListEntity.companyName = companyName;
  }
  final String? operationTimeEnd = jsonConvert.convert<String>(json['operationTimeEnd']);
  if (operationTimeEnd != null) {
    getDeviceRecordsListEntity.operationTimeEnd = operationTimeEnd;
  }
  final dynamic deviceId = json['deviceId'];
  if (deviceId != null) {
    getDeviceRecordsListEntity.deviceId = deviceId;
  }
  final int? createTime = jsonConvert.convert<int>(json['createTime']);
  if (createTime != null) {
    getDeviceRecordsListEntity.createTime = createTime;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    getDeviceRecordsListEntity.companyId = companyId;
  }
  final int? systemId = jsonConvert.convert<int>(json['systemId']);
  if (systemId != null) {
    getDeviceRecordsListEntity.systemId = systemId;
  }
  final String? monitorCode = jsonConvert.convert<String>(json['monitorCode']);
  if (monitorCode != null) {
    getDeviceRecordsListEntity.monitorCode = monitorCode;
  }
  final String? deviceCode = jsonConvert.convert<String>(json['deviceCode']);
  if (deviceCode != null) {
    getDeviceRecordsListEntity.deviceCode = deviceCode;
  }
  return getDeviceRecordsListEntity;
}

Map<String, dynamic> $GetDeviceRecordsListEntityToJson(GetDeviceRecordsListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['maintenanceRecords'] = entity.maintenanceRecords;
  data['operatorsId'] = entity.operatorsId;
  data['operators'] = entity.operators;
  data['operationTimeStart'] = entity.operationTimeStart;
  data['companyName'] = entity.companyName;
  data['operationTimeEnd'] = entity.operationTimeEnd;
  data['deviceId'] = entity.deviceId;
  data['createTime'] = entity.createTime;
  data['companyId'] = entity.companyId;
  data['systemId'] = entity.systemId;
  data['monitorCode'] = entity.monitorCode;
  data['deviceCode'] = entity.deviceCode;
  return data;
}

extension GetDeviceRecordsListEntityExtension on GetDeviceRecordsListEntity {
  GetDeviceRecordsListEntity copyWith({
    int? id,
    String? maintenanceRecords,
    int? operatorsId,
    String? operators,
    String? operationTimeStart,
    String? companyName,
    String? operationTimeEnd,
    dynamic deviceId,
    int? createTime,
    int? companyId,
    int? systemId,
    String? monitorCode,
    String? deviceCode,
  }) {
    return GetDeviceRecordsListEntity()
      ..id = id ?? this.id
      ..maintenanceRecords = maintenanceRecords ?? this.maintenanceRecords
      ..operatorsId = operatorsId ?? this.operatorsId
      ..operators = operators ?? this.operators
      ..operationTimeStart = operationTimeStart ?? this.operationTimeStart
      ..companyName = companyName ?? this.companyName
      ..operationTimeEnd = operationTimeEnd ?? this.operationTimeEnd
      ..deviceId = deviceId ?? this.deviceId
      ..createTime = createTime ?? this.createTime
      ..companyId = companyId ?? this.companyId
      ..systemId = systemId ?? this.systemId
      ..monitorCode = monitorCode ?? this.monitorCode
      ..deviceCode = deviceCode ?? this.deviceCode;
  }
}